﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<PhotoGalleryEnteties.PhotoInfo>" %>
<%@ Import Namespace="PhotoGalleryEnteties" %>
<%@ Import Namespace="photogalleryMVC.Models" %>

<div class="photo">
   
        <a class="imgReference"  href ="<%=Url.Action( "Detail","Photo",new{id = Model.PhotoId   } ) %>">
            <div>
            <img src="<%=Url.Action( "GetPhoto","Photo",new{ photoType = PhotoType.ImageThumbnail ,id = Model.PhotoId    } )  %>" alt="" />
            </div>
        </a>
       
       <div class ="PropertyList">
              <div class="property" >
                <div class="display-label ">Title:</div>
                
                    <div class="display-field ItemTitle"><span class="TextClip"><%=Model.Title  %></span></div>
                
            </div>
            <div class="property">
                <div class="display-label">Addition date:</div>
                <div class="display-field"><%: String.Format("{0:g}", Model.CreationDate ) %></div>
            </div>
            <div class="property">
                <div class="display-label">Width:</div>
                <div class="display-field"><%: Model.Width %></div>
            </div>
            <div class="property">
                <div class="display-label">Height:</div>
                <div class="display-field"><%: Model.Height %></div>
            </div>
        </div>
         <%if ((bool)ViewData["IsEditor"]){%>
            <%=Html.ActionLink( "Set as avatar","SetAvatar","Account",new {id=Model.PhotoId ,returnUrl=Url.Action( "Details",new{id= ViewData["AlbumId"] ,page=ViewData ["CurrentPage"]   }  )},null) %>
            <%=Html.ActionLink("Delete", "Delete", "Photo", new {id = Model.PhotoId }, null)%>

        <% }%>
        <div class="clear"></div>

</div>      

